package com.fsnbigdata.service.impl;
import com.fsnbigdata.service.api.ParkDistrictOrganismService;
import org.springframework.roo.addon.layers.service.annotations.RooServiceImpl;
import com.fsnbigdata.domain.ParkDistrict;
import com.fsnbigdata.domain.ParkDistrictOrganism;
import com.fsnbigdata.repository.ParkDistrictOrganismRepository;
import io.springlets.data.domain.GlobalSearch;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * = ParkDistrictOrganismServiceImpl
 *
 * TODO Auto-generated class documentation
 *
 */
@RooServiceImpl(service = ParkDistrictOrganismService.class)
@Service
@Transactional(readOnly = true)
public class ParkDistrictOrganismServiceImpl implements ParkDistrictOrganismService {

    /**
     * TODO Auto-generated attribute documentation
     *
     */
    private ParkDistrictOrganismRepository parkDistrictOrganismRepository;

    /**
     * TODO Auto-generated constructor documentation
     *
     * @param parkDistrictOrganismRepository
     */
    @Autowired
    public ParkDistrictOrganismServiceImpl(ParkDistrictOrganismRepository parkDistrictOrganismRepository) {
        setParkDistrictOrganismRepository(parkDistrictOrganismRepository);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return ParkDistrictOrganismRepository
     */
    public ParkDistrictOrganismRepository getParkDistrictOrganismRepository() {
        return parkDistrictOrganismRepository;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param parkDistrictOrganismRepository
     */
    public void setParkDistrictOrganismRepository(ParkDistrictOrganismRepository parkDistrictOrganismRepository) {
        this.parkDistrictOrganismRepository = parkDistrictOrganismRepository;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param entity
     * @return ParkDistrictOrganism
     */
    @Transactional
    public ParkDistrictOrganism save(ParkDistrictOrganism entity) {
        return getParkDistrictOrganismRepository().save(entity);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return ParkDistrictOrganism
     */
    public ParkDistrictOrganism findOne(Long id) {
        return getParkDistrictOrganismRepository().findOne(id);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return ParkDistrictOrganism
     */
    public ParkDistrictOrganism findOneForUpdate(Long id) {
        return getParkDistrictOrganismRepository().findOneDetached(id);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param ids
     * @return List
     */
    public List<ParkDistrictOrganism> findAll(Iterable<Long> ids) {
        return getParkDistrictOrganismRepository().findAll(ids);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param parkDistrict
     * @param globalSearch
     * @param pageable
     * @return Page
     */
    public Page<ParkDistrictOrganism> findByParkDistrict(ParkDistrict parkDistrict, GlobalSearch globalSearch, Pageable pageable) {
        return getParkDistrictOrganismRepository().findByParkDistrict(parkDistrict, globalSearch, pageable);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param parkDistrict
     * @return Long
     */
    public long countByParkDistrict(ParkDistrict parkDistrict) {
        return getParkDistrictOrganismRepository().countByParkDistrict(parkDistrict);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Class
     */
    public Class<ParkDistrictOrganism> getEntityType() {
        return ParkDistrictOrganism.class;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Class
     */
    public Class<Long> getIdType() {
        return Long.class;
    }
}
